package com.nali.dal.statement.function.formatter;

import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import com.nali.dal.statement.function.FunctionException;
import com.nali.dal.statement.function.SingleArgumentDataHandler;
import com.nali.dal.statement.util.number.NumberWrapper;

@Component
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
public class Rolling extends SingleArgumentDataHandler<Number, Number> {
	private NumberWrapper value = new NumberWrapper(0);

	@Override
	protected Number handle(Number argument) throws FunctionException {
		return value.add(argument).getValue();
	}
}

